<?php
/**
 * Created by PhpStorm.
 * User: jingshou
 * Date: 2017/9/17
 * Time: 23:57
 */

namespace app\mobile\model;

use think\Model;
use think\Session;

class Banner extends Model
{
    public function getImgThumbAttr()
    {
        $imgs = explode('/', $this->img);
        return !empty($imgs) ? $imgs[0] . '/thumb/' . $imgs[1] : null;
    }

    public function getList($num, $condition)
    {
        return self::where($condition)->order('id asc')->limit($num)->select();
    }
}